<?xml version="1.0" encoding="utf-8"?>
<ControllerConfig Name="em12">	
<Scripts>	  
  <Script ID="BtnSetPasswordClick">
	 <![CDATA[ 
		[&Password&] = 0;
	]]>
 </Script>
 <Script ID="BtnSetAdminPasswordClick">
	 <![CDATA[ 		
		[&Password&] = 25608;			
	]]>
 </Script> 
  <Script ID="OnPasswordInit">
	 <![CDATA[ 		
		if ([&Password&] == 33024 || [&Password&] == 25608)
		{			
			var gainBinaryStr = [&GainBit2&].toString()  + [&GainBit1&].toString();		
			switch (gainBinaryStr)
			{
				case '11':
					[&Gains&] = 1;									
					break;
				case '10':
					[&Gains&] = 2;		
					break;
				case '01':
					[&Gains&] = 3;				
					break;
				case '00':
					[&Gains&] = 4;				
					break;
				default:
					[&Gains&] = 0;
					break;
			}		
		}		
	]]>
 </Script>
 <Script ID="BtnRestartClick">
	 <![CDATA[ 
		[&Command&] = 326;
		[&Gains&] = 0;
		[&TransKoeffAuto&] = 0;		
	]]>
 </Script>
 <Script ID="BtnClearClick">
	 <![CDATA[ 
		[&Command&] = 560;
	]]>
 </Script>
 <Script ID="BtnSaveClick">
	 <![CDATA[ 
		[&Command&] = 666;
	]]>
 </Script>
 <Script ID="OnTransKoeffAutoChange">
			<![CDATA[
						var koeff = [&TransKoeffAuto&];
						var nom = -1;
						var denom = 1;
						switch (koeff)
						{
							case 1:
								nom = 1000;										
								break;
							case 2:
								nom = 500;		
								break;
							case 3:
								nom = 125;		
								break;
							case 4:
								nom = 100;		
								break;
							case 5:
								nom = 50;		
								break;
							case 6:
								nom = 1;		
								break;
							case 7:
								nom = 500;		
								break;
							default:
								break;
						}								
						if (nom != -1)
						{
							[&TransKoefNom0&] = nom;
							[&TransKoefDenom0&] = denom;
							[&TransKoefNom1&] = nom;
							[&TransKoefDenom1&] = denom;
							[&TransKoefNom2&] = nom;
							[&TransKoefDenom2&] = denom;
						}					
					]]>
  </Script>
<Script ID="OnGainChange">
			<![CDATA[
						var Gain = [&Gains&];		
						switch (Gain)
						{
							case 1:
								[&Command&] = 5001;									
								break;
							case 2:
								[&Command&] = 5002;		
								break;
							case 3:
								[&Command&] = 5004;				
								break;
							case 4:
								[&Command&] = 5008;				
								break;
							default:
								break;
						}								
					]]>
  </Script>   
</Scripts>
</ControllerConfig>
